# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=LWP-MediaTypes
pkgname=perl-${_realname}
pkgver=6.02
pkgrel=2
pkgdesc="Guess the media type of a file or a URL"
arch=('any')
url="https://metacpan.org/release/LWP-MediaTypes"
groups=('perl-modules')
depends=('perl')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
source=(https://www.cpan.org/authors/id/G/GA/GAAS/${_realname}-${pkgver}.tar.gz)
sha256sums=('18790b0cc5f0a51468495c3847b16738f785a2d460403595001e0b932e5db676')

build() {
  cd "${srcdir}/${_realname}-${pkgver}"
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make test
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="$pkgdir" install
}
